package com.authine.cloudpivot.ext.dto.form;

import com.authine.cloudpivot.ext.Enum.InvoiceBusinessType;
import com.authine.cloudpivot.ext.Enum.OriginIDType;
import com.authine.cloudpivot.ext.dto.model.invoice.ApplyInvoiceDetailDto;
import com.authine.cloudpivot.ext.dto.model.invoice.InvoiceExtendsAttr;
import com.authine.cloudpivot.ext.dto.model.trade.Trade;
import com.authine.mvp.app.launcher.domain.SelectorFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Builder
@Schema(description = "申请开票表单数据实体")
public class InvoiceApplyForm {


    private String id;
    @Schema(description = "发票类型(VatOrdinary=增值税普通发票,VatSpecial=增值税专用发票)")
    private String type;
    @Schema(description = "InvoiceBusinessType业务类型（Product=货物发票，Service=服务费发票）")
    private String business_type;
    @Schema(description = "方向,Sale=销售，Purchase=采购。必填", required = true)
    private String direction;

    @Schema(description = "销售方组织ID ")
    private SelectorFormat sale_organization_id;
    @Schema(description = "销售方组织全名 ")
    private String sale_organization_name;

    @Schema(description = "购买方组织ID")
    private SelectorFormat purchase_organization_id;
    @Schema(description = "购买方组织ID")
    private String purchase_organization_name;
    @Schema(description = "发票抬头")
    private String purchase_name;
    @Schema(description = "企业税号")
    private String purchase_number;
    @Schema(description = "发票地址")
    private String purchase_address;
    @Schema(description = "开票电话")
    private String purchase_phone;
    @Schema(description = "开户行")
    private String purchase_bank;
    @Schema(description = "银行账号")
    private String purchase_account;
//    @Schema(description = "票面价税合计")
//    private BigDecimal total;
//    @Schema(description = "票面价格小计")
//    private BigDecimal price_amount;
//    @Schema(description = "票面税额小计")
//    private BigDecimal tax_amount;


    @Schema(description = "发票备注")
    private String memo;
    @Schema(description = "收票地址")
    private String address;
    @Schema(description = "收票人名称")
    private String receiver;
    @Schema(description = "收票人电话")
    private String phone;
    @Schema(description = "创建发票的维度(e.g:Trade(交易) | CustomerOrder(销售-客户订单)) | VendorOrder(采购-供应商订单) | Bill (账单)")
    private OriginIDType invoiceCreationWays;
    @Schema(description = "true保存并提交，false只保存")
    private boolean submit;
    @Schema(description = "申请人ID")
    private String apply_member_id;
    @Schema(description = "申请人全名")
    private String apply_member_name;
    @Schema(description = "扩展字段")
    private InvoiceExtendsAttr extendsAttr;
    @Schema(description = "交易业务类型")
    private String trade_order_type;

    @Schema(description = "开票明细")
    private List<ApplyInvoiceDetailDto> applyInvoiceDetailDtoList;
}
